#!/bin/sh

LOC=$PKG_ROOT/etc/charon/key.rsa
EXIT=""

test -e $LOC || {
	echo "You need to create an RSA key and put it in $LOC"
	echo "The easiest way to do this is to install openssl and use the command:"
	echo "	openssl genrsa -out key.rsa 1024"
	echo "Please see http://wiki.rcpt.to/perl/wiki.pl?CharonRootKey for more information."
	echo
	
	EXIT=yes
}

/usr/sbin/iptables -L -n -m quota > /dev/null || {
    echo "You need to install the quota iptables extension. This is not currently"
    echo "available as a package."
    echo "Please see http://wiki.rcpt.to/perl/wiki.pl?CharonIptablesQuota for more information."
    echo

    EXIT=yes
}

test -z "$EXIT" || exit 1

# TODO - check perms on key, warn/fail if & 0x77